aaa=sqlContext.read.orc("/user/hive/warehouse/tmp.db/sms_log")
aaa.registerTempTable("base")
df=sqlContext.sql("""

    select
        *
    FROM
        base
    WHERE
        smslabel LIKE '%证券%'
        OR smslabel LIKE '%股票%'
        OR smslabel LIKE '%投资%'
        OR smslabel LIKE '%币%'
""")
df.repartition(1).write.mode("overwrite").orc("/user/hive/warehouse/tmp.db/zhengquan_20181022/" )

aaa=sqlContext.read.orc("/user/hive/warehouse/tmp.db/zhengquan_20181022/*")
aaa.registerTempTable("aaa")
df=sqlContext.sql("""
    select msisdn FROM
      aaa ORDER BY insert_time desc
""")